#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QUdpSocket>
#include <QNetworkInterface>
#include <QHostAddress>
#include <QByteArray>
#include <QTimer>
#include <QScrollArea>
#include <QScrollBar>
#include <QThread>

#include <ViewerService.h>
#include <MessageListWidget.h>
#include <FilterDialog.h>
#include <SendMessageDialog.h>
#include <MessageCreationDialog.h>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
    Ui::MainWindow *ui;
    MessageListWidget* modelMsgList;
    QAction* actionFilter;
    QAction* actionClear;
    QAction* actionSendMessage;
    QThread thread;
    ViewerService* service;

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void setupToolBar();
    void setupMenu();
    QString getStyleSheet();
    void paintEvent(QPaintEvent *);

public slots:
    void onActionClearTriggered();
    void onActionFilterTriggered();
    void onActionSendMessageTriggered();
    void onActionSettingsTriggered();
    void onActionConnectTriggered(bool);
    void addMessage(QxPLMessage);

signals:
    void startService();
    void stopService();
    void messageToSend(QxPLMessage);
};

#endif // MAINWINDOW_H
